<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("UTF-8");
	String htmlData = request.getParameter("content1") != null? request.getParameter("content1"): "";
%>
<!DOCTYPE HTML>
<html>
<head>
<%@include file="../common.jsp"%>
	<title>添加论文</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<!-- 	<link rel="stylesheet" type="text/css" href="resources/css/common.css"> -->
	<script type="text/javascript" src="resources/js/thesis/add_thesis.js"></script>
	
	<!--kindEditor -->
	<link rel="stylesheet"href="resources/js/kindeditor/themes/default/default.css" />
	<link rel="stylesheet"href="resources/js/kindeditor/plugins/code/prettify.css" />
	<script charset="utf-8" src="resources/js/kindeditor/kindeditor.js"></script>
	<script charset="utf-8" src="resources/js/kindeditor/lang/zh_CN.js"></script>
	<script charset="utf-8"src="resources/js/kindeditor/plugins/code/prettify.js"></script>
	
<!-- 	<script type="text/javascript" src="resources/js/jquery.tagbox.js"></script>
	<link rel="stylesheet" type="text/css"href="resources/css/jquery.tagbox.css"> -->
	
	
	<!-- 断点上传 -->
	<link rel="stylesheet" href="resources/css/webuploader.css" />
	<link rel="stylesheet" href="resources/css/bootstrap/bootstrap.css" />
	<script src="resources/js/md5.js" type="text/javascript" charset="utf-8"></script>
	<script src="resources/js/webuploader.js" type="text/javascript"charset="utf-8"></script>
	<script src="resources/js/fileUpload.js" type="text/javascript"charset="utf-8"></script> 
	
	<script src="resources/js/tag/jquery.tagsinput.js"></script>
	<link href="resources/js/tag/jquery.tagsinput.css" rel="stylesheet" />	
	
<script>
 		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content1"]', {
				cssPath : 'resources/js/kindeditor/plugins/code/prettify.css',
				uploadJson : 'resources/js/kindeditor/jsp/upload_json.jsp',
				fileManagerJson : 'resources/js/kindeditor/jsp/file_manager_json.jsp',
				allowFileManager : true,
/* 				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
				}  */
				
				afterBlur: function(){
					this.sync();
				}
			});
			prettyPrint();
		});
		
</script>
</head>
<body>
	<div class="content">
		<ol class="breadcrumb">
			<li><a href="thesis.htm">论文图书馆列表</a></li>
			<li class="active">添加论文</li>
		</ol>
		<!-- 添加 -->
		<div class="modal-body" style="margin-left:50px;">
			<div id="itemFileName"></div>
			<div style="height:50px;">
				<ul id="theList"></ul>
			</div>
			<div id="uploader">
				<button id="picker" resetValue="0" class="btn btn-primary ">选择文件</button>
			</div>
		</div>

		<div class="modal-content">
			<div class="modal-body">
				<form id="form_add" class="form-horizontal" role="form">
					<input type="hidden" name="url" id="url">
					<div class="form-group">
						<label class="col-sm-2 control-label required">论文标题</label>
						<div class="col-sm-4">
							<input type="text" name="name" placeholder="50字以内,如:建筑设计"
								class="form-control" data-toggle="tooltip" data-placement="top"
								title="请输入不多于50个字">
						</div>
						<label class="col-sm-2 control-label required">论文格式</label>
						<div class="col-sm-4">
							<select class="form-control" name="type" placeholder="选择论文格式"
								data-toggle="tooltip" data-placement="top" title="请选择论文格式">
								<option value="0" selected="selected">请选择...</option>
							</select>
						</div>
					</div>

					<div class="form-group">
						<label class="col-md-2 control-label required">一级分类</label>
						<div class='col-md-2'>
							<select class="form-control" name="top" placeholder="选择一级分类"
								data-toggle="tooltip" data-placement="top" title="请选择一级分类">
								<option value="0" selected="selected">请选择...</option>
							</select>
						</div>
						<label class="col-md-2 control-label required ">二级分类</label>
						<div class='col-md-2'>
							<select class="form-control" name="second" placeholder="选择二级分类"
								data-toggle="tooltip" data-placement="top" title="请选择二级分类">
								<option value="0" selected="selected">请选择...</option>
							</select>
						</div>
						<label class="col-md-2 control-label required">三级分类</label>
						<div class='col-md-2'>
							<select class="form-control" name="detail"  placeholder="选择三级分类" data-toggle="tooltip" data-placement="top"title="请选择三级分类">
								<option value="0" selected="selected">请选择三级分类...</option>
							</select>
						</div>
					</div>

					<div class="form-group">
						<label class="col-sm-2 control-label">价格</label>
						<div class="col-sm-4">
							<input type="text" name="price" class="form-control" value="0">
						</div>

						<label class="col-sm-2 control-label required">浏览的基数</label>
						<div class="col-sm-4">
							<input type="text" name="cardinal" placeholder=""
								class="form-control" data-toggle="tooltip" data-placement="top"
								title="请输入浏览基数">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">来源</label>
						<div class="col-sm-4">
							<input type="text" name="source" placeholder="请输入来源"
								class="form-control" data-toggle="tooltip" data-placement="top"
								title="请输入来源" >
						</div>

						<label class="col-sm-2 control-label ">作者</label>
						<div class="col-sm-4">
							<input type="text" name="author" placeholder=""
								class="form-control" data-toggle="tooltip" data-placement="top"
								title="请输入作者">
						</div>
					</div>
						<div class="form-group">
						<label class="col-sm-2 control-label">参考文献</label>
						<div class="col-sm-4">
								<input id="reference" type="text" class="tags" value="" />
						</div>

						<label class="col-sm-2 control-label required">是否是学术论文</label>
						<div class="col-sm-4">
							<input type="radio" name="status"  value="1">是&nbsp;&nbsp;<input type="radio" name="status"  value= "0"  checked>否
						</div>
					</div>				
					<div class="form-group">
						<label class="col-sm-2 control-label required">标签</label>
						<div class="col-sm-10">
							<input id="tags" type="text" class="tags" value="" />
						</div>
					</div>

					<div class="form-group">
						<label class="col-sm-2 control-label required">论文简介</label>
						<div class="col-sm-10">
							<%=htmlData%>
							<!-- <form name="example" method="post" action="file_list.jsp"> -->
							<textarea id="introduction" name="content1" cols="100" rows="8"
								style="width:100%;height:200px;"><%=htmlspecialchars(htmlData)%></textarea>
							<br />
							<!--<input type="submit" name="button" value="提交内容" /> (提交快捷键: Ctrl + Enter)
							 </form>	 -->
						</div>
					</div>
				</form>
			</div>
			<div class="modal-footer">
				<button id="btn_confirm_add" type="button" class="btn btn-primary">确定</button>
			</div>
		</div>
	</div>
</body>
</html>

<%!private String htmlspecialchars(String str) {
		str = str.replaceAll("&", "&amp;");
		str = str.replaceAll("<", "&lt;");
		str = str.replaceAll(">", "&gt;");
		str = str.replaceAll("\"", "&quot;");
		return str;
	}%>